package com.shiyi.design.factory.factorymethod;

import com.shiyi.design.factory.factorymethod.foods.Vegetables;

/**
 * @Author qiu
 * @Date 2021/1/12 22:49
 */
public class FactoryMethodTest {

    public static void main(String[] args) {
        AbstractVegetablesFactory factory1 = new PotatoFactory();
        Vegetables vegetables1 = factory1.create();
        System.out.println(vegetables1.getName());

        AbstractVegetablesFactory factory2 = new TomatoFactory();
        Vegetables vegetables2 = factory2.create();
        System.out.println(vegetables2.getName());
    }
}
